<template>
  <div class="box">
    <el-container>
      <el-header>
        <el-card shadow="hover" style="margin: 0.5% auto; height: 80%; text-align: center;background-color: #20a0ff">
          广州粤电廉江风电场光伏发电项目里程碑节点图
        </el-card>
      </el-header>
      <el-main>
        <el-descriptions direction="vertical" :column="6" border style="width: 40%;margin: auto auto" label-style="text-align: center" content-style="text-align: center">
          <el-descriptions-item label="正常"><i class="el-icon-location-outline"></i></el-descriptions-item>
          <el-descriptions-item label="未完成"><i class="el-icon-delete-location"></i></el-descriptions-item>
          <el-descriptions-item label="提前完成"><i class="el-icon-magic-stick"></i></el-descriptions-item>
          <el-descriptions-item label="按时完成"><i class="el-icon-location"></i></el-descriptions-item>
          <el-descriptions-item label="延期完成"><i class="el-icon-heavy-rain"></i></el-descriptions-item>
          <el-descriptions-item label="提醒"><i class="el-icon-alarm-clock"></i></el-descriptions-item>
        </el-descriptions>
        <el-divider></el-divider>
        <el-steps :active="1" v-loading="milestonesLoading" align-center>
          <el-step v-for="milestoneNode in milestones"
                   :key="milestoneNode.id"
                   :title="milestoneNode.name"
                   :description="milestoneNode.date"
                   :icon="milestoneNode.type"><button>11</button></el-step>
        </el-steps>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import { queryMilestonesByProjectId } from '@/api/project'

export default {
  data() {
    return {
      milestonesLoading: true,
      milestones: []
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.milestonesLoading = true
      queryMilestonesByProjectId().then(response => {
        this.milestones = response.data.items
        this.milestonesLoading = false
      })
    }
  }
}
</script>

<style scoped>
.box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.low-button {
  margin: 2.5% auto;
}
.el-header {
  /*background-color: #B3C0D1;*/
  /*color: #333;*/
  text-align: center;
  height: 20%;
}
.el-main {
  /*background-color: #E9EEF3;*/
  /*color: #333;*/
  text-align: center;
  height: 80%;
}
.el-container {
  height: 100%;
}
.el-row {
  height: 100%;
  /*margin-bottom: 20px;*/
}
.el-col {
  height: 100%;
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
